cc.Class({
    extends: cc.Component,

    properties: {
        lblName:cc.Label,
        lblGems:cc.Label,
        lblID:cc.Label,
        lblNotice:cc.Label,
        joinGameWin:cc.Node,
        createRoomWin:cc.Node,
        settingsWin:cc.Node,
        helpWin:cc.Node,
        xiaoxiWin:cc.Node,
        btnJoinGame:cc.Node,
        btnReturnGame:cc.Node,
        sprHeadImg:cc.Sprite,
    },

    // use this for initialization
    onLoad: function () {

    },

    onBtnClicked:function(event){
        if(event.target.name == "btn_shezhi"){
            this.settingsWin.active = true;
        }
        else if(event.target.name == "btn_help"){
            this.helpWin.active = true;
        }
        else if(event.target.name == "btn_xiaoxi"){
            this.xiaoxiWin.active = true;
        }
        else if(event.target.name == "head"){
            cc.vv.userinfoShow.show(cc.vv.userMgr.userName,cc.vv.userMgr.userId,this.sprHeadImg,cc.vv.userMgr.sex,cc.vv.userMgr.ip);
        }
    },
    onCreateRoomClicked:function(){
        //if(cc.vv.gameNetMgr.roomId != null){
        //    cc.vv.alert.show("提示","房间已经创建!\n必须解散当前房间才能创建新的房间");
        //    return;
        //}
        console.log("onCreateRoomClicked");
        this.createRoomWin.active = true;
    },


    update: function (dt) {
        var x = this.lblNotice.node.x;
        x -= dt*100;
        if(x + this.lblNotice.node.width < -1000){
            x = 500;
        }
        this.lblNotice.node.x = x;

        //if(cc.vv && cc.vv.userMgr.roomData != null){
        //    cc.vv.userMgr.enterRoom(cc.vv.userMgr.roomData);
        //    cc.vv.userMgr.roomData = null;
        //}
    },
});
